<?php
class PasswordConfirmValidator extends CustomValidator
{
	function DoValidate(&$formars,&$error_hash)
	{
      	if (preg_match ('/^(\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*){6,20}$/', $formars['pass']) ) {
			if ($formars['pass'] == $formars['pass2']) {
				return true;
			} else {
				$error_hash['pass2']="Your password did not match the confirmed password!";
				return false;
			}
		} else {
			$error_hash['pass1']="Please enter a valid password!";
			return false;
		}
	}
	

}
?>